package dmt16.TelemetrySuit.UI
{
	import dmt16.TelemetrySuit.UI.Assets.TargetBtn_ico;
	
	import flash.display.DisplayObject;
	import flash.display.DisplayObjectContainer;
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	
	public class TargetBtn extends Sprite
	{
		public function TargetBtn()
		{
			_btn=new TargetBtn_ico();
			addChild(_btn);
			
			_layer1=DisplayObjectContainer(_btn.getChildAt(0)).getChildAt(0);
			_layer2=DisplayObjectContainer(_btn.getChildAt(0)).getChildAt(1);
		}
		
		private var _btn:TargetBtn_ico;
		private var _layer1:DisplayObject;
		private var _layer2:DisplayObject;
		
		private var _state:Boolean=false;
		public function get state():Boolean{
			return _state;	
		}
		public function set state(value:Boolean):void{
			_state=value;
			_layer1.visible=_state;
			_layer2.visible=!_state;
		}
	}
}